/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.classes.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.AllArgsConstructor;
import org.springblade.modules.classes.entity.ClassesEntity;
import org.springblade.modules.classes.entity.ClassesPlanEntity;
import org.springblade.modules.classes.service.IClassesPlanService;
import org.springblade.modules.classes.service.IClassesUserService;
import org.springblade.modules.classes.service.ITrainingPlanCourseService;
import org.springblade.modules.classes.vo.ClassesVO;
import org.springblade.modules.classes.excel.ClassesExcel;
import org.springblade.modules.classes.mapper.ClassesMapper;
import org.springblade.modules.classes.service.IClassesService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import java.util.List;

/**
 * 班级表 服务实现类
 *
 * @author junxin
 * @since 2023-04-28
 */
@Service
@AllArgsConstructor
public class ClassesServiceImpl extends BaseServiceImpl<ClassesMapper, ClassesEntity> implements IClassesService {
	private final IClassesPlanService classesPlanService;
	private final IClassesUserService classesUserService;

	@Override
	public IPage<ClassesVO> selectClassesPage(IPage<ClassesVO> page, ClassesVO classes) {
		return page.setRecords(baseMapper.selectClassesPage(page, classes));
	}


	@Override
	public List<ClassesExcel> exportClasses(Wrapper<ClassesEntity> queryWrapper) {
		List<ClassesExcel> classesList = baseMapper.exportClasses(queryWrapper);
		//classesList.forEach(classes -> {
		//	classes.setTypeName(DictCache.getValue(DictEnum.YES_NO, Classes.getType()));
		//});
		return classesList;
	}

	@Override
	public void traineesScorelist(Long classesId) {
		ClassesPlanEntity classesPlanEntity = classesPlanService.getOne(Wrappers.<ClassesPlanEntity>query().lambda().eq(ClassesPlanEntity::getClassesId, classesId));
		if (null!=classesPlanEntity){
			//根据planId去查询考试
			Long planId = classesPlanEntity.getPlanId();




		}


	}

}
